Is there any convenient way to check if a DOM element is `$compile`d in AngularJS?

Posted by Tong Shen on Stack Overflow See other posts from Stack Overflow or by Tong Shen
Published on 2014-06-03T03:21:40Z Indexed on 2014/06/03 3:24 UTC
Read the original article Hit count: 167

I'm trying to integrate some plain JavaScript library with AngularJS, in which I need to manually $compile some DOM elements. I'm doing the compilation like this:

$compile(e.srcElement)($scope);

e.srcElement is the DOM element I want to $compile.

I wonder, if there is any established way to check if a given DOM element has been compiled.

I know it's possible if I attach some data attributes to the DOM during compiling, and try to retrieve that later. What I want to know is if there is any existing method in AngularJS.

Thank you!

© Stack Overflow or respective owner

Related posts about angularjs

Related posts about angularjs-compile